package server

import (
	"context"

	"go-weixin/app/usercenter/rpc/internal/logic"
	"go-weixin/app/usercenter/rpc/internal/svc"
	"go-weixin/app/usercenter/rpc/pb/proto/usercenter"
)

type RoleServer struct {
	svcCtx *svc.ServiceContext
	usercenter.UnimplementedRoleServer
}

func NewRoleServer(svcCtx *svc.ServiceContext) *RoleServer {
	return &RoleServer{
		svcCtx: svcCtx,
	}
}
func (s *RoleServer) RoleAdd(ctx context.Context, in *usercenter.RoleAddReq) (*usercenter.RoleAddResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleAdd(in)
}

func (s *RoleServer) RoleUpdate(ctx context.Context, in *usercenter.RoleUpdateReq) (*usercenter.RoleUpdateResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleUpdate(in)
}

func (s *RoleServer) RoleAddPower(ctx context.Context, in *usercenter.RoleAddPowerReq) (*usercenter.RoleAddPowerResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleAddPower(in)
}
func (s *RoleServer) RoleUpdatePower(ctx context.Context, in *usercenter.RoleUpdatePowerReq) (*usercenter.RoleUpdatePowerResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleUpdatePower(in)
}
func (s *RoleServer) RoleList(ctx context.Context, in *usercenter.RoleListReq) (*usercenter.RoleListResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleList(in)
}
func (s *RoleServer) RoleDetail(ctx context.Context, in *usercenter.RoleDetailReq) (*usercenter.RoleDetailResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleDetail(in)
}

func (s *RoleServer) RoleGetUser(ctx context.Context, in *usercenter.RoleGetUserReq) (*usercenter.RoleGetUserResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleGetUser(in)
}

func (s *RoleServer) RoleGetPower(ctx context.Context, in *usercenter.RoleGetPowerReq) (*usercenter.RoleGetPowerResp, error) {
	l := logic.NewRoleLogic(ctx, s.svcCtx)
	return l.RoleGetPower(in)
}
